<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the cursor to the beginning of the result set</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongocursor.reset.html">« MongoCursor::reset</a></li>
      <li style="float: right;"><a href="mongocursor.setflag.html">MongoCursor::setFlag »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongocursor.html">MongoCursor</a></li>
    <li>Returns the cursor to the beginning of the result set</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongocursor.rewind" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoCursor::rewind</h1>
  <p class="verinfo">(PECL mongo &gt;=0.9.0)</p><p class="refpurpose"><span class="refname">MongoCursor::rewind</span> &mdash; <span class="dc-title">Returns the cursor to the beginning of the result set</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongocursor.rewind-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>MongoCursor::rewind</strong></span>(): <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   This is identical to the function:
  </p>
  <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">rewind</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">reset</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongocursor.rewind-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongocursor.rewind-returnvalues">
  <h3 class="title">Return Values</h3>  
  <p class="para">
   <strong><code>null</code></strong>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongocursor.rewind-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Throws <a href="class.mongoconnectionexception.html" class="classname">MongoConnectionException</a> if it cannot reach the
   database and <a href="class.mongocursortimeoutexception.html" class="classname">MongoCursorTimeoutException</a> if the
   timeout is exceeded.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongocursor.rewind-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><strong>Iterator::rewind()</strong></span></li>
  </ul>
 </div>

</div></div></div></body></html>